﻿//========================================================================
// *作者：海盗猫  主页：ilplay.com
// *脚本：IUIEntity
// *描述：IUIEntity
// *?2024 HDMCode . All rights reserved.
//* ======================================================================

namespace HDMCode.UIFrame
{
    public interface IUIEntity
    {
        /// <summary>
        /// 预加载UI资源
        /// </summary>
        public void PreLoad();
        
        /// <summary>
        /// 显示UI
        /// </summary>
        public void ShowUI();

        /// <summary>
        /// 带参显示一个UI
        /// </summary>
        /// <param name="parameter">需要携带的参数</param>
        /// <typeparam name="T">任意传递类型</typeparam>
        public void ShowUI<T>(T parameter);

        /// <summary>
        /// 销毁UI
        /// </summary>
        public void DestroyUI();

        /// <summary>
        /// 播放UI动画
        /// </summary>
        /// <param name="animationName">需要播放的动画名称</param>
        /// <param name="time">需要延时的时间</param>
        public UIEntityEvent Play(string animationName, float time);

        /// <summary>
        /// 播放UI打开音频
        /// </summary>
        /// <param name="time">播放事件</param>
        /// <returns>播放完成回调</returns>
        public UIEntityEvent AudioOpen(float time = 0.3f);

        /// <summary>
        /// 播放UI关闭音频
        /// </summary>
        /// <param name="time"></param>
        /// <returns>播放完成回调</returns>
        public UIEntityEvent AudioClose(float time = 0.3f);
    }
}
